package atm;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * 存款界面
 */
public class SavePanel extends JPanel implements ActionListener {
    private ATM05 atm05;
    private JLabel saveLabel = new JLabel("请输入存款金额:");
    private JTextField saveTextField = new JTextField();
    private JButton sureBtn = new JButton(new ImageIcon("images/buttonSure.jpg"));
    private JButton clearBtn = new JButton(new ImageIcon("images/buttonClear.jpg"));
    private Font font = new Font("宋体",Font.BOLD,25);

    public SavePanel(ATM05 atm05){
        this.atm05 = atm05;
        this.setLayout(null);
        this.setOpaque(false);

        saveLabel.setBounds(300,200,200,50);
        saveLabel.setFont(font);
        saveTextField.setBounds(300,260,300,50);
        saveTextField.setFont(font);
        sureBtn.setBounds(320,340,100,50);
        clearBtn.setBounds(450,340,100,50);
        sureBtn.addActionListener(this);

        this.add(saveLabel);
        this.add(saveTextField);
        this.add(sureBtn);
        this.add(clearBtn);
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        atm05.showPanel("menu");
    }
}
